﻿/* 
	PureMVC CSharp / WPF / EmployeeAdmin Demo - Login
	By Andy Adamczak <andy.adamczak@puremvc.org>
	Copyright(c) 2009 Andy Adamczak, Some rights reserved.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using PureMVC.Patterns;
using PureMVC.Interfaces;

using GEF2.Model;
using GEF2.View;

namespace GEF2.Controller
{
	public class StartupCommand : SimpleCommand, ICommand
	{
		/// <summary>
		/// Register the Proxies and Mediators.
		/// 
		/// Get the View Components for the Mediators from the app,
		/// which passed a reference to itself on the notification.
		/// </summary>
		/// <param name="note"></param>
		public override void Execute(INotification note)
		{
            EntityProxy entityProxy = new EntityProxy();
            Facade.RegisterProxy(entityProxy);
            Facade.RegisterProxy(new SearchProxy(entityProxy));

            MainWindow window = (MainWindow)note.Body;
            Facade.RegisterMediator(new EntityFormMediator(window));
            Facade.RegisterMediator(new EntityListMediator(window.EntityListWindow()));

		}
	}
}
